#include "note.c"
int main(){
    setlocale(LC_ALL,"");
    int flag=1;
    //system("chcp 65001");
    system("cls"); 
    tag_head= init();
    if(tag_head==NULL)return 0;
    while (flag)
    {
        put_all_note();
        wprintf(L"请输入测试指令：\n");
        wprintf(L"1.添加\n2.按标签名搜索\n");
        wprintf(L"3.删除标签\n4.保存并退出\n");
        wprintf(L"5.输出全部标签\n");
        if(!wscanf(L"%d", &flag)||flag>5||flag<1){
            wprintf(L"\nWrong commond指令错误!\n\n");
            system("pause");
            flag=4;
        }
        switch (flag)
        {
            case 3:
                delete_note();
                break;
            case 5:
                system("cls");
                output_tags();
                break;
            case 1:
                system("cls"); 
                add_new_note();
                break;
            case 2:
                system("cls"); 
                search_by_tag();
                break;
            case 4:
                save_all();
                system("cls");
                return 0;
        }
    }
}
